/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package dmcn.bl.genetics.fitnessfunction;

import dmcn.bl.genetics.input.Input;
import org.jgap.FitnessFunction;
import org.jgap.IChromosome;

/**
 *
 * @author Home
 */
public class AssignTerminalFitnessFunction extends FitnessFunction {

    private int numOfConcetrators;
    private int numOfTerminals;
    private int[][] localCost;
    private int[] localFortio;
    private int[] localXwritikothta;

    public AssignTerminalFitnessFunction(int numOfConcetrators, int numOfTerminals, int[][] cost, int[] fortio, int[] xwritikothta) {
        this.numOfConcetrators = numOfConcetrators;
        this.numOfTerminals = numOfTerminals;
        this.localCost = cost;
        this.localFortio = fortio;
        this.localXwritikothta = xwritikothta;
    }

    @Override
    protected double evaluate(IChromosome ic) {

        Evaluator evaluator = new Evaluator(numOfConcetrators,numOfTerminals,localCost,localFortio,localXwritikothta);
        Double d = evaluator.evaluate(ic);
        return (d == null) ? Integer.MAX_VALUE : d;

    }
}
